home *** CD-ROM | disk | FTP | other *** search
-
- #pragma once
-
- #include <StringTools.h>
-
- /*=======================================================================*/
- /*= This file contains a set of utilities for doing nifty toolbox stuff =*/
- /*=======================================================================*/
-
- #define kEnter 3
- #define kDelete 8
- #define kTab 9
- #define kReturn 13
- #define kEscape 27
- #define kLeftArrow 0x1C
- #define kRightArrow 0x1D
- #define kUpArrow 0x1E
- #define kDownArrow 0x1F
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- pascal void saveThatA5()
- = {0x2f0d, 0x2a68, 0xFFFC};
-
- pascal void restoreThatA5()
- = {0x2a5f};
-
- Boolean ButtonStillDownAfterN (long NumTicks);
- /* return true if the button is still down after the specified # of ticks */
-
- StringPtr GetChooserName (StringPtr Default);
- /* return the name which the chooser contains as the user name */
-
- Boolean CommandKeyDown (short modifierKeys);
- /* return true if the command key is held down */
-
- Boolean ShiftKeyDown (short modifierKeys);
- /* return true if the shift key is held down */
-
- Boolean OptionKeyDown (short modifierKeys);
- /* return true if the option key is held down */
-
- Boolean ControlKeyDown (short modifierKeys);
- /* return true if the control key is held down */
-
- short isPressed(unsigned short k );
- /* return ¬0 if the key whose code is k is pressed, 0 otherwise */
-
- short getModifiers (void);
- /* get the states of all the modifier keys on the keyboard and return them */
- /* in the format used in the 'modifier' field of an event record */
-
- void TimeString (long inDateTime, Boolean showAMPM, StringPtr DestString, short maxLen);
- /* Given a Macintosh DateTime quantity, return a string of the format */
- /* hr:mn:sec [A|P]M */
-
- void CurrentTimeString (Boolean showAMPM, StringPtr DestString, short maxLen);
- /* Return a string of the format hr:mn:sec [A|P]M which represents the current time */
-
- void ErrorAlert (short ErrorID, StringPtr Message);
- /* Puts up a dialog which displays an error in one of the
- following ways:
- 1) if there is an STR resource with the same ID as ErrorID, that
- message is displayed along with the passed-in message
- 2) if there is no STR resource, the ErrorID and the passed-in
- message are displayed.
- */
-
- void CenterRect (Rect *Source, Rect *Target, Boolean CenterH, Boolean CenterV);
- /* center the source inside the target according to CenterH and centerV */
- /* Source rectangle is modified, Target rectangle is not changed */
-
- pascal void SetMenuItemText(MenuHandle theMenu,short item,StringPtr itemString);
-
- void CopyResource (short RFrom, short RTo, ResType itsType, short itsID);
- /* copy the specified resource from the resource file specified by */
- /* RFrom into the resource file specified by RTo */
-
- #ifdef __cplusplus
- }
- #endif